<?php
	 
	//Initialize Nebula Office framework
	require_once('../../system.php');
	
	//Load commonly used controls
	load_basic_controls();
	
	//Authenticate the user for the framework
	$GO_SECURITY->authenticate();
	
	//Authenticate the user for the module
	$GO_MODULES->authenticate('docmanager');
	
	//Get the language variables
	require_once($GO_LANGUAGE->get_language_file('docmanager'));
	
	//Require the module class
	require_once($GO_MODULES->class_path.'docmanager.class.inc');
	require_once($GO_MODULES->class_path.'docmanager_list.class.inc');
	$docmanager = new docmanager();
	$docmanager_list = new docmanager_list('docmanager_list', $GO_SECURITY->user_id, false, true, 'docmanager_form', $GO_MODULES->modules['docmanager']['url']);
	// docmanager头部需要包含的文件，一般为js文件
	$GO_HEADER['head'] = $docmanager_list->get_header();
	//Declare variables
	$post_action = isset($_REQUEST['post_action']) ? $_REQUEST['post_action'] : '';	
	$task = isset($_REQUEST['task']) ? $_REQUEST['task'] : '';
	$link_back=$_SERVER['PHP_SELF'];
	
	$form = new form('docmanager_form');
	$form->add_html_element(new input('hidden','task','',false));
	
	
	

	
	//create menu. The buttons are added in the include files.
	$menu = new button_menu();
	$menu->add_button('new_docmanager',$lang_docmanager['new_docmanager'],$GO_MODULES->modules['doc_manager']['url'].'new_docmanager.php');
	$menu->add_button('delete_docmanager',$lang_docmanager['delete_docmanager'],$docmanager_list->get_delete_handler());
	
	
	$form->add_html_element($menu);
	$form->add_html_element($docmanager_list);
	
	require($GO_THEME->theme_path.'header.inc');
	echo $form->get_html();
	require($GO_THEME->theme_path.'footer.inc');
	